<?php
//技术与支持-服务公告
$curr_page =2;
include 'head.php';

$current_page = 1;//当前第几页
$pages = 5;//每页几条
$Count =0;//总共多少条
//检查当前页是否合法
if(isset($_GET['pages']))
{
	$current_page = $_GET['pages']+1;
}


//查询总条数
$sql =  "select count(*) as num from en_problem where flag = 1";
$row = mysql_fetch_array(mysql_query($sql));
$Count = $row["num"];
?>
<link href="1.css" rel="stylesheet" type="text/css">
<link href="js/pagination/pagination.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="js/pagination/jquery.pagination.js"></script>
<style>
 .nava{
 	color:#369;
	text-decoration:none;
 }
 .nava:hover{
	text-decoration:underline;
 }
</style>
<script>
	$(document).ready(function(){
			
			$("#Pagination").pagination(<?php echo $Count;?>, {
			    num_edge_entries: 1,//边缘页数
			    num_display_entries: 4,//主体页数
			    current_page:<?php echo $current_page-1;?> ,
			    items_per_page:<?php echo $pages;?>,//每页显示项
			    link_to:"?pages=__id__",
			    callback:function(){}
			});
		});
</script>


	
	 
	 <!--页面内容-->
     <div id="main"  style="background: #FFFFFF;width:960px; height:1100px;">
	     
		 <div id="dh" style="background:none;">
		  
		 
			 
			 <!--列表导航-->
			 <div class="gg1">
			 
			 		<div class="gddh">Service Support</div>
					<div class="gddh1"><a class="nava" href="service.php" >Announcement</a></div>
					<div class="gddh1"><a class="nava" href="dealer.php" >Sales Outlets</a></div>
					<div class="gddh1"><a class="nava" href="question.php" >FAQ</a></div>
					<div class="gg2" style="margin-top:35px;background:none;">
					 <?php
					   $sql = "select * from en_ad where id = 6";
					   $ret = mysql_query($sql);
					   $rcd = mysql_fetch_array($ret);
					 ?>
					 <a href="<?php echo $rcd['link']?>" target='_blank'><img src="<?php echo $rcd['pic_path'];?>" /></a>
					</div>
			        <div class="gg2" style=" background-image:none;margin-top:15px;">
					 <?php
					   $sql = "select * from en_ad where id = 7";
					   $ret = mysql_query($sql);
					   $rcd = mysql_fetch_array($ret);
					 ?>
					 <a href="<?php echo $rcd['link']?>" target='_blank'><img src="<?php echo $rcd['pic_path'];?>" /></a>
			        </div>
			        <div class="gg2" style="margin-top:15px;background:none;">
					 <?php
					   $sql = "select * from en_ad where id = 8";
					   $ret = mysql_query($sql);
					   $rcd = mysql_fetch_array($ret);
					 ?>
					 <a href="<?php echo $rcd['link']?>" target='_blank'><img src="<?php echo $rcd['pic_path'];?>" /></a>
			        </div>
					
				
			 </div>
			 <!--列表导航-->
			 
			 
			 <!--公告-->
			 	<div class="nrdh"><h1 style="text-indent:16px; margin-top:11px;">Announcement</h1></div>
			 
			 	<div style="width:735px; height:1031px; border:1px solid #c8c8c8; float:right; margin-right:16px; margin-top:-1px;">
			 <!--公告-->
			 	<div style="height:920px;">
			 <!--公告内容-->
			  <?php 
			  		$sql = "select id,title,path,remark,dates,_reads from en_problem where flag =1 order by dates desc limit ".($current_page-1)*$pages.",".$pages;
			  		$result = mysql_query($sql);
			  		while($row = mysql_fetch_array($result)){
			  			
			  			$remark = $row["remark"];
				  		if(strlen($row['remark'])>130)
					    {
					    	$remark = mb_substr($row['remark'],0,130,'utf-8') ;
					    	$remark = $remark."...";
					    }
			  			
			  ?>
			  	<div style="width:717px; height:180px;margin:7px 0 0 9px; ">
						<!--推荐列表-->
						<div style=" float:left; text-align:center; width:717px; height:28px; margin-top:13px;">
						
						<div style="background-color:#f1f1f1; width:717px; height:28px; font-family:'宋体'; font-size:12px; color:#393939">
							<div style="background:url(images/fx.jpg); width:13px; height:15px; float:left; margin:8px 0 0 7px;"></div>
								<span style="line-height:28px; float:left; margin-left:12px;"><?php echo $row["title"];?></span>
								<span style="line-height:28px; float: right; margin-right:12px; color:#8e8e8e"><?php echo $row['dates'];?></span>
							</div>
							<div>
								<div style="width:717px; height:96px; margin-top:15px;">
									<div style="float:left; width:567px; height:58px; margin-top:15px; text-align:left; line-height:20px;font-size:12px;">
										<a style="width:567px; height:58px; float:left;"><?php echo $remark;?></a>
										<div style="float:left;"><span style="color:#81a615; font-weight:bold;"><?php echo $row["_reads"];?></span><span> Readed</span></div>
										<div style="float: right;"><span style="color:#81a615; font-weight:bold;"><a href="service_info.php?id=<?php echo $row['id']?>" style="color:#81a615;text-decoration:none;">Detail> ></a></span></div>
										
									</div>
									<a style="float: right;"><img style="width:128px;height:96px;" src="<?php echo $row['path'];?>" /></a>
							</div>
							
							</div>
						</div>
			  	</div>
			  <?php
			  		}
			  ?>
			 	</div>
			
							<div id="Pagination" class="pagination" style="margin-top:31px;text-align:center;">
									
							</div>	
			</div>
			
			
			 
			 
			 
			 
	     </div>
		  
	 </div>
		<?php include 'bottom.php';?>
	 
	 <!--页面内容-->
	 
